streamlit-nightly 1.44.2.dev20250421__py3-none-any.whl → 1.44.2.dev20250422__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. streamlit/components/types/base_custom_component.py +9 -0
  2. streamlit/components/v1/custom_component.py +21 -0
  3. streamlit/config.py +5 -1
  4. streamlit/elements/iframe.py +35 -0
  5. streamlit/env_util.py +4 -4
  6. streamlit/proto/Components_pb2.py +10 -10
  7. streamlit/proto/Components_pb2.pyi +6 -1
  8. streamlit/proto/IFrame_pb2.py +3 -3
  9. streamlit/proto/IFrame_pb2.pyi +8 -2
  10. streamlit/proto/MetricsEvent_pb2.py +4 -4
  11. streamlit/proto/MetricsEvent_pb2.pyi +7 -1
  12. streamlit/proto/NewSession_pb2.py +2 -2
  13. streamlit/proto/NewSession_pb2.pyi +16 -1
  14. streamlit/runtime/app_session.py +6 -1
  15. streamlit/runtime/context.py +11 -1
  16. streamlit/runtime/context_util.py +49 -0
  17. streamlit/static/index.html +1 -1
  18. streamlit/static/static/js/{ErrorOutline.esm.BRFl1bVT.js → ErrorOutline.esm.Bp2ldccU.js} +1 -1
  19. streamlit/static/static/js/{FileDownload.esm.BlVcbv80.js → FileDownload.esm.BFGQMqxg.js} +1 -1
  20. streamlit/static/static/js/{FileHelper.Cu8b3qYc.js → FileHelper.CLfR2Nl5.js} +1 -1
  21. streamlit/static/static/js/{FormClearHelper.D0_ew-pr.js → FormClearHelper.DN7_Z3pK.js} +1 -1
  22. streamlit/static/static/js/{Hooks.DskP_qUg.js → Hooks.Dr0GH325.js} +1 -1
  23. streamlit/static/static/js/{InputInstructions.B57U_Pck.js → InputInstructions.BmCPiwuH.js} +1 -1
  24. streamlit/static/static/js/{ProgressBar.B5UexUoj.js → ProgressBar.C1S12VpK.js} +1 -1
  25. streamlit/static/static/js/{RenderInPortalIfExists.CCx_j2kS.js → RenderInPortalIfExists.CfxGSPro.js} +1 -1
  26. streamlit/static/static/js/Toolbar.BMxjLFs_.js +1 -0
  27. streamlit/static/static/js/{base-input.vMZreRbs.js → base-input.BLpJZP2E.js} +1 -1
  28. streamlit/static/static/js/{checkbox.BvzLW9mz.js → checkbox.CIgBIQZk.js} +1 -1
  29. streamlit/static/static/js/{createSuper.Bw1znQ_0.js → createSuper.DBgOP3Du.js} +1 -1
  30. streamlit/static/static/js/{data-grid-overlay-editor.D7LIqz-H.js → data-grid-overlay-editor.CSVlRStP.js} +1 -1
  31. streamlit/static/static/js/{downloader.wxNZEkm4.js → downloader.B2XHI8Rs.js} +1 -1
  32. streamlit/static/static/js/{es6.CUH1kXnl.js → es6.Dopsw67W.js} +2 -2
  33. streamlit/static/static/js/{iframeResizer.contentWindow.D1Um7X41.js → iframeResizer.contentWindow.C85rYpfO.js} +1 -1
  34. streamlit/static/static/js/{index.CR-jcBpI.js → index.3HfBohwS.js} +1 -1
  35. streamlit/static/static/js/{index.BJ6Emr34.js → index.6uvkM5kA.js} +1 -1
  36. streamlit/static/static/js/{index.EKcIoWDD.js → index.9mIvDHDJ.js} +1 -1
  37. streamlit/static/static/js/{index.D1Ywuv8r.js → index.BL3Kr9Rq.js} +1 -1
  38. streamlit/static/static/js/{index.DiU_iAr0.js → index.BV4FE5kB.js} +1 -1
  39. streamlit/static/static/js/{index.CLIjAXFe.js → index.BVHpAfQR.js} +1 -1
  40. streamlit/static/static/js/{index.CZUFT1MU.js → index.BiV4F66u.js} +1 -1
  41. streamlit/static/static/js/{index.ClJO7cQG.js → index.BpYJxTkk.js} +9 -9
  42. streamlit/static/static/js/{index.DhCNOffY.js → index.Bpd8CsZ5.js} +1 -1
  43. streamlit/static/static/js/{index.C0-tCzek.js → index.Bpy9n229.js} +1 -1
  44. streamlit/static/static/js/{index.DyMFPM-N.js → index.BwyCju0E.js} +1 -1
  45. streamlit/static/static/js/{index.BLmWFo9v.js → index.C00os7bA.js} +1 -1
  46. streamlit/static/static/js/{index.B-Cvaa60.js → index.C2MtHl98.js} +1 -1
  47. streamlit/static/static/js/index.C56IkBvU.js +1 -0
  48. streamlit/static/static/js/{index.8SbOAOpf.js → index.C7p03y_M.js} +1 -1
  49. streamlit/static/static/js/{index.Csw8C3i3.js → index.CCX5EIu8.js} +1 -1
  50. streamlit/static/static/js/{index.B8eIzqFV.js → index.CCYDqcpA.js} +1 -1
  51. streamlit/static/static/js/{index.DbSwoQrX.js → index.CEWxPngV.js} +1 -1
  52. streamlit/static/static/js/{index.DocZB9LB.js → index.CSVdq4RM.js} +54 -54
  53. streamlit/static/static/js/{index.DIVoc7sf.js → index.CWB411xq.js} +1 -1
  54. streamlit/static/static/js/{index.ByJVLduZ.js → index.CZ-a2zEe.js} +1 -1
  55. streamlit/static/static/js/{index.BXIy_sno.js → index.CrSmh1fy.js} +1 -1
  56. streamlit/static/static/js/{index.DeTKJCBX.js → index.D4vkE8k4.js} +1 -1
  57. streamlit/static/static/js/{index.C6Ddq_0T.js → index.DMSrAr4X.js} +1 -1
  58. streamlit/static/static/js/{index.B8aTojaJ.js → index.DN3zE0RU.js} +1 -1
  59. streamlit/static/static/js/{index.CCgmQo2Y.js → index.DN_7WvH0.js} +1 -1
  60. streamlit/static/static/js/{index.Dykp8DiM.js → index.DPcAZ75a.js} +1 -1
  61. streamlit/static/static/js/{index.DbLDusYd.js → index.DYVqVcRM.js} +1 -1
  62. streamlit/static/static/js/index.DZxZM7Ek.js +1 -0
  63. streamlit/static/static/js/{index.DcXPvVuL.js → index.DeS0IkWE.js} +1 -1
  64. streamlit/static/static/js/{index.CYrMenWX.js → index.DojXbCby.js} +1 -1
  65. streamlit/static/static/js/{index._x_ll-5l.js → index.DoribfgZ.js} +1 -1
  66. streamlit/static/static/js/{index.CixhwxuT.js → index.HAb52J76.js} +1 -1
  67. streamlit/static/static/js/{index.EqUN-1C8.js → index.Kw3W98Th.js} +1 -1
  68. streamlit/static/static/js/{index.J03z7hBk.js → index.PNpPr6uJ.js} +1 -1
  69. streamlit/static/static/js/{index.IKI2QU6M.js → index.p0aNteOo.js} +1 -1
  70. streamlit/static/static/js/{index.C0kRoccm.js → index.q8SJCyGp.js} +1 -1
  71. streamlit/static/static/js/{input.CfYPTrU0.js → input.CCoe_psd.js} +1 -1
  72. streamlit/static/static/js/{memory.C6WsZ9vL.js → memory.DJlUxbbU.js} +1 -1
  73. streamlit/static/static/js/{mergeWith.BEl-rFPc.js → mergeWith.BIF_NZCa.js} +1 -1
  74. streamlit/static/static/js/{number-overlay-editor.Da6_ovQT.js → number-overlay-editor.V-rRAT06.js} +1 -1
  75. streamlit/static/static/js/{possibleConstructorReturn.DrzRVntz.js → possibleConstructorReturn.DJfAQe4D.js} +1 -1
  76. streamlit/static/static/js/{sandbox.BDmQFJ29.js → sandbox.Dg0KTNPN.js} +1 -1
  77. streamlit/static/static/js/{textarea.B1KRwam8.js → textarea.D3KTVlzD.js} +1 -1
  78. streamlit/static/static/js/{timepicker.CJQu2ZZT.js → timepicker.Bz2YVuxL.js} +1 -1
  79. streamlit/static/static/js/{toConsumableArray.c1K-jW6k.js → toConsumableArray.B93v6_qJ.js} +1 -1
  80. streamlit/static/static/js/{uniqueId.DQubPWuJ.js → uniqueId.Binq0oUN.js} +1 -1
  81. streamlit/static/static/js/{useBasicWidgetState.Bnt7ikdj.js → useBasicWidgetState.CvULcwlh.js} +1 -1
  82. streamlit/static/static/js/{useOnInputChange.Dq_CVqBo.js → useOnInputChange.CuQA4gaj.js} +1 -1
  83. streamlit/static/static/js/{withFullScreenWrapper.5xnZ4GI8.js → withFullScreenWrapper.RQKRDDEV.js} +1 -1
  84. {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250422.dist-info}/METADATA +1 -1
  85. {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250422.dist-info}/RECORD +89 -88
  86. streamlit/static/static/js/Toolbar.D3gt1ynD.js +0 -1
  87. streamlit/static/static/js/index.B4uSRoDZ.js +0 -1
  88. streamlit/static/static/js/index.BUcUcSdx.js +0 -1
  89. {streamlit_nightly-1.44.2.dev20250421.data → streamlit_nightly-1.44.2.dev20250422.data}/scripts/streamlit.cmd +0 -0
  90. {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250422.dist-info}/WHEEL +0 -0
  91. {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250422.dist-info}/entry_points.txt +0 -0
  92. {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250422.dist-info}/top_level.txt +0 -0
@@ -60,6 +60,7 @@ class BaseCustomComponent(ABC):
60
60
  default: Any = None,
61
61
  key: str | None = None,
62
62
  on_change: WidgetCallback | None = None,
63
+ tab_index: int | None = None,
63
64
  **kwargs,
64
65
  ) -> Any:
65
66
  """An alias for create_instance."""
@@ -68,6 +69,7 @@ class BaseCustomComponent(ABC):
68
69
  default=default,
69
70
  key=key,
70
71
  on_change=on_change,
72
+ tab_index=tab_index,
71
73
  **kwargs,
72
74
  )
73
75
 
@@ -113,6 +115,7 @@ class BaseCustomComponent(ABC):
113
115
  default: Any = None,
114
116
  key: str | None = None,
115
117
  on_change: WidgetCallback | None = None,
118
+ tab_index: int | None = None,
116
119
  **kwargs,
117
120
  ) -> Any:
118
121
  """Create a new instance of the component.
@@ -131,6 +134,12 @@ class BaseCustomComponent(ABC):
131
134
  component's "widget ID".
132
135
  on_change: WidgetCallback or None
133
136
  An optional callback invoked when the widget's value changes. No arguments are passed to it.
137
+ tab_index: int or None
138
+ Specifies the tab order of the iframe containing the component.
139
+ Possible values are:
140
+ - ``None`` (default): Browser default behavior.
141
+ - ``-1``: Removes the iframe from the natural tab order, but it can still be focused programmatically.
142
+ - ``0`` or positive integer: Includes the iframe in the natural tab order.
134
143
  **kwargs
135
144
  Keyword args to pass to the component.
136
145
 
@@ -52,6 +52,7 @@ class CustomComponent(BaseCustomComponent):
52
52
  default: Any = None,
53
53
  key: str | None = None,
54
54
  on_change: WidgetCallback | None = None,
55
+ tab_index: int | None = None,
55
56
  **kwargs,
56
57
  ) -> Any:
57
58
  """An alias for create_instance."""
@@ -60,6 +61,7 @@ class CustomComponent(BaseCustomComponent):
60
61
  default=default,
61
62
  key=key,
62
63
  on_change=on_change,
64
+ tab_index=tab_index,
63
65
  **kwargs,
64
66
  )
65
67
 
@@ -70,6 +72,7 @@ class CustomComponent(BaseCustomComponent):
70
72
  default: Any = None,
71
73
  key: str | None = None,
72
74
  on_change: WidgetCallback | None = None,
75
+ tab_index: int | None = None,
73
76
  **kwargs,
74
77
  ) -> Any:
75
78
  """Create a new instance of the component.
@@ -88,6 +91,12 @@ class CustomComponent(BaseCustomComponent):
88
91
  component's "widget ID".
89
92
  on_change: WidgetCallback or None
90
93
  An optional callback invoked when the widget's value changes. No arguments are passed to it.
94
+ tab_index : int, optional
95
+ Specifies the tab order of the iframe containing the component.
96
+ Possible values are:
97
+ - ``None`` (default): Browser default behavior.
98
+ - ``-1``: Removes the iframe from the natural tab order, but it can still be focused programmatically.
99
+ - ``0`` or positive integer: Includes the iframe in the natural tab order.
91
100
  **kwargs
92
101
  Keyword args to pass to the component.
93
102
 
@@ -100,6 +109,16 @@ class CustomComponent(BaseCustomComponent):
100
109
  if len(args) > 0:
101
110
  raise MarshallComponentException(f"Argument '{args[0]}' needs a label")
102
111
 
112
+ # Validate tab_index according to web specifications
113
+ if tab_index is not None and not (
114
+ isinstance(tab_index, int)
115
+ and not isinstance(tab_index, bool)
116
+ and tab_index >= -1
117
+ ):
118
+ raise StreamlitAPIException(
119
+ "tab_index must be None, -1, or a non-negative integer."
120
+ )
121
+
103
122
  try:
104
123
  import pyarrow # noqa: F401, ICN001
105
124
 
@@ -148,6 +167,8 @@ And if you're using Streamlit Cloud, add "pyarrow" to your requirements.txt."""
148
167
  element.component_instance.form_id = current_form_id(dg)
149
168
  if self.url is not None:
150
169
  element.component_instance.url = self.url
170
+ if tab_index is not None:
171
+ element.component_instance.tab_index = tab_index
151
172
 
152
173
  # Normally, a widget's element_hash (which determines
153
174
  # its identity across multiple runs of an app) is computed
streamlit/config.py CHANGED
@@ -711,7 +711,11 @@ def _server_headless() -> bool:
711
711
  Default: false unless (1) we are on a Linux box where DISPLAY is unset, or
712
712
  (2) we are running in the Streamlit Atom plugin.
713
713
  """
714
- if env_util.IS_LINUX_OR_BSD and not os.getenv("DISPLAY"):
714
+ if (
715
+ env_util.IS_LINUX_OR_BSD
716
+ and not os.getenv("DISPLAY")
717
+ and not os.getenv("WAYLAND_DISPLAY")
718
+ ):
715
719
  # We're running in Linux and DISPLAY is unset
716
720
  return True
717
721
 
@@ -16,6 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  from typing import TYPE_CHECKING, cast
18
18
 
19
+ from streamlit.errors import StreamlitAPIException
19
20
  from streamlit.proto.IFrame_pb2 import IFrame as IFrameProto
20
21
  from streamlit.runtime.metrics_util import gather_metrics
21
22
 
@@ -31,6 +32,8 @@ class IframeMixin:
31
32
  width: int | None = None,
32
33
  height: int | None = None,
33
34
  scrolling: bool = False,
35
+ *,
36
+ tab_index: int | None = None,
34
37
  ) -> DeltaGenerator:
35
38
  """Load a remote URL in an iframe.
36
39
 
@@ -59,6 +62,12 @@ class IframeMixin:
59
62
  does not show a scrollbar. If this is ``True``, Streamlit shows a
60
63
  scrollbar when the content is larger than the iframe.
61
64
 
65
+ tab_index : int, optional
66
+ Specifies the tab order of the iframe. Possible values are:
67
+ - ``None`` (default): Browser default behavior.
68
+ - ``-1``: Removes the iframe from the natural tab order, but it can still be focused programmatically.
69
+ - ``0`` or positive integer: Includes the iframe in the natural tab order.
70
+
62
71
  Example
63
72
  -------
64
73
 
@@ -74,6 +83,7 @@ class IframeMixin:
74
83
  width=width,
75
84
  height=height,
76
85
  scrolling=scrolling,
86
+ tab_index=tab_index,
77
87
  )
78
88
  return self.dg._enqueue("iframe", iframe_proto)
79
89
 
@@ -84,6 +94,8 @@ class IframeMixin:
84
94
  width: int | None = None,
85
95
  height: int | None = None,
86
96
  scrolling: bool = False,
97
+ *,
98
+ tab_index: int | None = None,
87
99
  ) -> DeltaGenerator:
88
100
  """Display an HTML string in an iframe.
89
101
 
@@ -115,6 +127,12 @@ class IframeMixin:
115
127
  does not show a scrollbar. If this is ``True``, Streamlit shows a
116
128
  scrollbar when the content is larger than the iframe.
117
129
 
130
+ tab_index : int, optional
131
+ Specifies the tab order of the iframe. Possible values are:
132
+ - ``None`` (default): Browser default behavior.
133
+ - ``-1``: Removes the iframe from the natural tab order, but it can still be focused programmatically.
134
+ - ``0`` or positive integer: Includes the iframe in the natural tab order.
135
+
118
136
  Example
119
137
  -------
120
138
 
@@ -132,6 +150,7 @@ class IframeMixin:
132
150
  width=width,
133
151
  height=height,
134
152
  scrolling=scrolling,
153
+ tab_index=tab_index,
135
154
  )
136
155
  return self.dg._enqueue("iframe", iframe_proto)
137
156
 
@@ -148,6 +167,7 @@ def marshall(
148
167
  width: int | None = None,
149
168
  height: int | None = None,
150
169
  scrolling: bool = False,
170
+ tab_index: int | None = None,
151
171
  ) -> None:
152
172
  """Marshalls data into an IFrame proto.
153
173
 
@@ -171,6 +191,8 @@ def marshall(
171
191
  scrolling : bool
172
192
  If true, show a scrollbar when the content is larger than the iframe.
173
193
  Otherwise, never show a scrollbar.
194
+ tab_index : int, optional
195
+ Specifies the tab order of the iframe.
174
196
 
175
197
  """
176
198
  if src is not None:
@@ -189,3 +211,16 @@ def marshall(
189
211
  proto.height = 150
190
212
 
191
213
  proto.scrolling = scrolling
214
+
215
+ if tab_index is not None:
216
+ # Validate tab_index according to web specifications
217
+ if not (
218
+ isinstance(tab_index, int)
219
+ and not isinstance(tab_index, bool)
220
+ and tab_index >= -1
221
+ ):
222
+ raise StreamlitAPIException(
223
+ "tab_index must be None, -1, or a non-negative integer."
224
+ )
225
+
226
+ proto.tab_index = tab_index
streamlit/env_util.py CHANGED
@@ -19,10 +19,10 @@ import platform
19
19
  import re
20
20
  import sys
21
21
 
22
- _system = platform.system()
23
- IS_WINDOWS = _system == "Windows"
24
- IS_DARWIN = _system == "Darwin"
25
- IS_LINUX_OR_BSD = (_system == "Linux") or ("BSD" in _system)
22
+ SYSTEM = platform.system().lower()
23
+ IS_WINDOWS = SYSTEM == "windows"
24
+ IS_DARWIN = SYSTEM == "darwin"
25
+ IS_LINUX_OR_BSD = (SYSTEM == "linux") or ("bsd" in SYSTEM)
26
26
 
27
27
 
28
28
  def is_pex() -> bool:
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/Components.proto\"\x8b\x01\n\x11\x43omponentInstance\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tjson_args\x18\x02 \x01(\t\x12!\n\x0cspecial_args\x18\x03 \x03(\x0b\x32\x0b.SpecialArg\x12\x16\n\x0e\x63omponent_name\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x06 \x01(\t\"_\n\nSpecialArg\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x0f\x61rrow_dataframe\x18\x02 \x01(\x0b\x32\x0f.ArrowDataframeH\x00\x12\x0f\n\x05\x62ytes\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05value\"J\n\x0e\x41rrowDataframe\x12\x19\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0b.ArrowTable\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\"]\n\nArrowTable\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63olumns\x18\x03 \x01(\x0c\x12!\n\x06styler\x18\x05 \x01(\x0b\x32\x11.ArrowTableStyler\"Y\n\x10\x41rrowTableStyler\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61ption\x18\x02 \x01(\t\x12\x0e\n\x06styles\x18\x03 \x01(\t\x12\x16\n\x0e\x64isplay_values\x18\x04 \x01(\x0c\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x43omponentsProtob\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/Components.proto\"\xb1\x01\n\x11\x43omponentInstance\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tjson_args\x18\x02 \x01(\t\x12!\n\x0cspecial_args\x18\x03 \x03(\x0b\x32\x0b.SpecialArg\x12\x16\n\x0e\x63omponent_name\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x06 \x01(\t\x12\x16\n\ttab_index\x18\x07 \x01(\x05H\x00\x88\x01\x01\x42\x0c\n\n_tab_index\"_\n\nSpecialArg\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x0f\x61rrow_dataframe\x18\x02 \x01(\x0b\x32\x0f.ArrowDataframeH\x00\x12\x0f\n\x05\x62ytes\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05value\"J\n\x0e\x41rrowDataframe\x12\x19\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0b.ArrowTable\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\"]\n\nArrowTable\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63olumns\x18\x03 \x01(\x0c\x12!\n\x06styler\x18\x05 \x01(\x0b\x32\x11.ArrowTableStyler\"Y\n\x10\x41rrowTableStyler\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61ption\x18\x02 \x01(\t\x12\x0e\n\x06styles\x18\x03 \x01(\t\x12\x16\n\x0e\x64isplay_values\x18\x04 \x01(\x0c\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x43omponentsProtob\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -23,13 +23,13 @@ if not _descriptor._USE_C_DESCRIPTORS:
23
23
  _globals['DESCRIPTOR']._loaded_options = None
24
24
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017ComponentsProto'
25
25
  _globals['_COMPONENTINSTANCE']._serialized_start=37
26
- _globals['_COMPONENTINSTANCE']._serialized_end=176
27
- _globals['_SPECIALARG']._serialized_start=178
28
- _globals['_SPECIALARG']._serialized_end=273
29
- _globals['_ARROWDATAFRAME']._serialized_start=275
30
- _globals['_ARROWDATAFRAME']._serialized_end=349
31
- _globals['_ARROWTABLE']._serialized_start=351
32
- _globals['_ARROWTABLE']._serialized_end=444
33
- _globals['_ARROWTABLESTYLER']._serialized_start=446
34
- _globals['_ARROWTABLESTYLER']._serialized_end=535
26
+ _globals['_COMPONENTINSTANCE']._serialized_end=214
27
+ _globals['_SPECIALARG']._serialized_start=216
28
+ _globals['_SPECIALARG']._serialized_end=311
29
+ _globals['_ARROWDATAFRAME']._serialized_start=313
30
+ _globals['_ARROWDATAFRAME']._serialized_end=387
31
+ _globals['_ARROWTABLE']._serialized_start=389
32
+ _globals['_ARROWTABLE']._serialized_end=482
33
+ _globals['_ARROWTABLESTYLER']._serialized_start=484
34
+ _globals['_ARROWTABLESTYLER']._serialized_end=573
35
35
  # @@protoc_insertion_point(module_scope)
@@ -36,6 +36,7 @@ class ComponentInstance(google.protobuf.message.Message):
36
36
  COMPONENT_NAME_FIELD_NUMBER: builtins.int
37
37
  URL_FIELD_NUMBER: builtins.int
38
38
  FORM_ID_FIELD_NUMBER: builtins.int
39
+ TAB_INDEX_FIELD_NUMBER: builtins.int
39
40
  id: builtins.str
40
41
  """The instance's "widget ID", used to uniquely identify it."""
41
42
  json_args: builtins.str
@@ -48,6 +49,7 @@ class ComponentInstance(google.protobuf.message.Message):
48
49
  that they're developing their component in.
49
50
  """
50
51
  form_id: builtins.str
52
+ tab_index: builtins.int
51
53
  @property
52
54
  def special_args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SpecialArg]:
53
55
  """Additional, non-JSON args. These require special processing
@@ -63,8 +65,11 @@ class ComponentInstance(google.protobuf.message.Message):
63
65
  component_name: builtins.str = ...,
64
66
  url: builtins.str = ...,
65
67
  form_id: builtins.str = ...,
68
+ tab_index: builtins.int | None = ...,
66
69
  ) -> None: ...
67
- def ClearField(self, field_name: typing.Literal["component_name", b"component_name", "form_id", b"form_id", "id", b"id", "json_args", b"json_args", "special_args", b"special_args", "url", b"url"]) -> None: ...
70
+ def HasField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "tab_index", b"tab_index"]) -> builtins.bool: ...
71
+ def ClearField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "component_name", b"component_name", "form_id", b"form_id", "id", b"id", "json_args", b"json_args", "special_args", b"special_args", "tab_index", b"tab_index", "url", b"url"]) -> None: ...
72
+ def WhichOneof(self, oneof_group: typing.Literal["_tab_index", b"_tab_index"]) -> typing.Literal["tab_index"] | None: ...
68
73
 
69
74
  global___ComponentInstance = ComponentInstance
70
75
 
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/IFrame.proto\"v\n\x06IFrame\x12\r\n\x03src\x18\x01 \x01(\tH\x00\x12\x10\n\x06srcdoc\x18\x02 \x01(\tH\x00\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x11\n\thas_width\x18\x04 \x01(\x08\x12\x0e\n\x06height\x18\x05 \x01(\x02\x12\x11\n\tscrolling\x18\x07 \x01(\x08\x42\x06\n\x04typeB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bIFrameProtob\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/IFrame.proto\"\x9c\x01\n\x06IFrame\x12\r\n\x03src\x18\x01 \x01(\tH\x00\x12\x10\n\x06srcdoc\x18\x02 \x01(\tH\x00\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x11\n\thas_width\x18\x04 \x01(\x08\x12\x0e\n\x06height\x18\x05 \x01(\x02\x12\x11\n\tscrolling\x18\x07 \x01(\x08\x12\x16\n\ttab_index\x18\x08 \x01(\x05H\x01\x88\x01\x01\x42\x06\n\x04typeB\x0c\n\n_tab_indexB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bIFrameProtob\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -22,6 +22,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.IFrame_pb2'
22
22
  if not _descriptor._USE_C_DESCRIPTORS:
23
23
  _globals['DESCRIPTOR']._loaded_options = None
24
24
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013IFrameProto'
25
- _globals['_IFRAME']._serialized_start=32
26
- _globals['_IFRAME']._serialized_end=150
25
+ _globals['_IFRAME']._serialized_start=33
26
+ _globals['_IFRAME']._serialized_end=189
27
27
  # @@protoc_insertion_point(module_scope)
@@ -34,6 +34,7 @@ class IFrame(google.protobuf.message.Message):
34
34
  HAS_WIDTH_FIELD_NUMBER: builtins.int
35
35
  HEIGHT_FIELD_NUMBER: builtins.int
36
36
  SCROLLING_FIELD_NUMBER: builtins.int
37
+ TAB_INDEX_FIELD_NUMBER: builtins.int
37
38
  src: builtins.str
38
39
  """A URL to load"""
39
40
  srcdoc: builtins.str
@@ -42,6 +43,7 @@ class IFrame(google.protobuf.message.Message):
42
43
  has_width: builtins.bool
43
44
  height: builtins.float
44
45
  scrolling: builtins.bool
46
+ tab_index: builtins.int
45
47
  def __init__(
46
48
  self,
47
49
  *,
@@ -51,9 +53,13 @@ class IFrame(google.protobuf.message.Message):
51
53
  has_width: builtins.bool = ...,
52
54
  height: builtins.float = ...,
53
55
  scrolling: builtins.bool = ...,
56
+ tab_index: builtins.int | None = ...,
54
57
  ) -> None: ...
55
- def HasField(self, field_name: typing.Literal["src", b"src", "srcdoc", b"srcdoc", "type", b"type"]) -> builtins.bool: ...
56
- def ClearField(self, field_name: typing.Literal["has_width", b"has_width", "height", b"height", "scrolling", b"scrolling", "src", b"src", "srcdoc", b"srcdoc", "type", b"type", "width", b"width"]) -> None: ...
58
+ def HasField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "src", b"src", "srcdoc", b"srcdoc", "tab_index", b"tab_index", "type", b"type"]) -> builtins.bool: ...
59
+ def ClearField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "has_width", b"has_width", "height", b"height", "scrolling", b"scrolling", "src", b"src", "srcdoc", b"srcdoc", "tab_index", b"tab_index", "type", b"type", "width", b"width"]) -> None: ...
60
+ @typing.overload
61
+ def WhichOneof(self, oneof_group: typing.Literal["_tab_index", b"_tab_index"]) -> typing.Literal["tab_index"] | None: ...
62
+ @typing.overload
57
63
  def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["src", "srcdoc"] | None: ...
58
64
 
59
65
  global___IFrame = IFrame
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
15
15
  from streamlit.proto import PageProfile_pb2 as streamlit_dot_proto_dot_PageProfile__pb2
16
16
 
17
17
 
18
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\x81\x07\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x15\n\rmachine_id_v4\x18) \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x0e\n\x06\x61pp_id\x18! \x01(\t\x12\x12\n\nsession_id\x18# \x01(\t\x12\x16\n\x0epython_version\x18$ \x01(\t\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\x10\n\x08numPages\x18\" \x01(\x03\x12\x18\n\x10page_script_hash\x18% \x01(\t\x12\x14\n\x0c\x61\x63tive_theme\x18& \x01(\t\x12\x17\n\x0ftotal_load_time\x18\' \x01(\x03\x12\"\n\x0c\x62rowser_info\x18( \x01(\x0b\x32\x0c.BrowserInfo\"]\n\x0b\x42rowserInfo\x12\x14\n\x0c\x62rowser_name\x18\x01 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x03 \x01(\t\x12\n\n\x02os\x18\x04 \x01(\tB1\n\x1c\x63om.snowflake.apps.streamlitB\x11MetricsEventProtob\x06proto3')
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\xa9\x07\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x15\n\rmachine_id_v4\x18) \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x0e\n\x06\x61pp_id\x18! \x01(\t\x12\x12\n\nsession_id\x18# \x01(\t\x12\x16\n\x0epython_version\x18$ \x01(\t\x12\x11\n\tserver_os\x18* \x01(\t\x12\x13\n\x0bhas_display\x18+ \x01(\x08\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\x10\n\x08numPages\x18\" \x01(\x03\x12\x18\n\x10page_script_hash\x18% \x01(\t\x12\x14\n\x0c\x61\x63tive_theme\x18& \x01(\t\x12\x17\n\x0ftotal_load_time\x18\' \x01(\x03\x12\"\n\x0c\x62rowser_info\x18( \x01(\x0b\x32\x0c.BrowserInfo\"]\n\x0b\x42rowserInfo\x12\x14\n\x0c\x62rowser_name\x18\x01 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x03 \x01(\t\x12\n\n\x02os\x18\x04 \x01(\tB1\n\x1c\x63om.snowflake.apps.streamlitB\x11MetricsEventProtob\x06proto3')
19
19
 
20
20
  _globals = globals()
21
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -24,7 +24,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
24
24
  _globals['DESCRIPTOR']._loaded_options = None
25
25
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\021MetricsEventProto'
26
26
  _globals['_METRICSEVENT']._serialized_start=74
27
- _globals['_METRICSEVENT']._serialized_end=971
28
- _globals['_BROWSERINFO']._serialized_start=973
29
- _globals['_BROWSERINFO']._serialized_end=1066
27
+ _globals['_METRICSEVENT']._serialized_end=1011
28
+ _globals['_BROWSERINFO']._serialized_start=1013
29
+ _globals['_BROWSERINFO']._serialized_end=1106
30
30
  # @@protoc_insertion_point(module_scope)
@@ -45,6 +45,8 @@ class MetricsEvent(google.protobuf.message.Message):
45
45
  APP_ID_FIELD_NUMBER: builtins.int
46
46
  SESSION_ID_FIELD_NUMBER: builtins.int
47
47
  PYTHON_VERSION_FIELD_NUMBER: builtins.int
48
+ SERVER_OS_FIELD_NUMBER: builtins.int
49
+ HAS_DISPLAY_FIELD_NUMBER: builtins.int
48
50
  HOSTED_AT_FIELD_NUMBER: builtins.int
49
51
  OWNER_FIELD_NUMBER: builtins.int
50
52
  REPO_FIELD_NUMBER: builtins.int
@@ -87,6 +89,8 @@ class MetricsEvent(google.protobuf.message.Message):
87
89
  app_id: builtins.str
88
90
  session_id: builtins.str
89
91
  python_version: builtins.str
92
+ server_os: builtins.str
93
+ has_display: builtins.bool
90
94
  hosted_at: builtins.str
91
95
  """Host tracking fields:"""
92
96
  owner: builtins.str
@@ -143,6 +147,8 @@ class MetricsEvent(google.protobuf.message.Message):
143
147
  app_id: builtins.str = ...,
144
148
  session_id: builtins.str = ...,
145
149
  python_version: builtins.str = ...,
150
+ server_os: builtins.str = ...,
151
+ has_display: builtins.bool = ...,
146
152
  hosted_at: builtins.str = ...,
147
153
  owner: builtins.str = ...,
148
154
  repo: builtins.str = ...,
@@ -174,7 +180,7 @@ class MetricsEvent(google.protobuf.message.Message):
174
180
  browser_info: global___BrowserInfo | None = ...,
175
181
  ) -> None: ...
176
182
  def HasField(self, field_name: typing.Literal["browser_info", b"browser_info"]) -> builtins.bool: ...
177
- def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
183
+ def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "has_display", b"has_display", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "server_os", b"server_os", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
178
184
 
179
185
  global___MetricsEvent = MetricsEvent
180
186
 
@@ -16,7 +16,7 @@ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
16
16
  from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
17
17
 
18
18
 
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xb6\x07\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x02\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x04\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x05\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x06\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\x07\x88\x01\x01\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x0f\n\r_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_color\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"D\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\tB/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xb6\x07\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x02\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x04\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x05\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x06\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\x07\x88\x01\x01\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x0f\n\r_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_color\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"l\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\t\x12\x11\n\tserver_os\x18\x03 \x01(\t\x12\x13\n\x0bhas_display\x18\x04 \x01(\x08\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
20
20
 
21
21
  _globals = globals()
22
22
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -47,5 +47,5 @@ if not _descriptor._USE_C_DESCRIPTORS:
47
47
  _globals['_USERINFO']._serialized_start=2044
48
48
  _globals['_USERINFO']._serialized_end=2141
49
49
  _globals['_ENVIRONMENTINFO']._serialized_start=2143
50
- _globals['_ENVIRONMENTINFO']._serialized_end=2211
50
+ _globals['_ENVIRONMENTINFO']._serialized_end=2251
51
51
  # @@protoc_insertion_point(module_scope)
@@ -485,14 +485,29 @@ class EnvironmentInfo(google.protobuf.message.Message):
485
485
 
486
486
  STREAMLIT_VERSION_FIELD_NUMBER: builtins.int
487
487
  PYTHON_VERSION_FIELD_NUMBER: builtins.int
488
+ SERVER_OS_FIELD_NUMBER: builtins.int
489
+ HAS_DISPLAY_FIELD_NUMBER: builtins.int
488
490
  streamlit_version: builtins.str
489
491
  python_version: builtins.str
492
+ server_os: builtins.str
493
+ """The name of the OS. Typically "windows", "mac", "linux",
494
+ but can take other values like "ios", "android", "freebsd8".
495
+ See https://docs.python.org/3/library/sys.html#sys.platform
496
+ """
497
+ has_display: builtins.bool
498
+ """True if Linux/BSD and DISPLAY or WAYLAND_DISPLAY environment variables are
499
+ set. This is used so we can tell when Streamlit is being executed in order
500
+ to develop the app (has_display = true) or to serve the app (has_display =
501
+ false).
502
+ """
490
503
  def __init__(
491
504
  self,
492
505
  *,
493
506
  streamlit_version: builtins.str = ...,
494
507
  python_version: builtins.str = ...,
508
+ server_os: builtins.str = ...,
509
+ has_display: builtins.bool = ...,
495
510
  ) -> None: ...
496
- def ClearField(self, field_name: typing.Literal["python_version", b"python_version", "streamlit_version", b"streamlit_version"]) -> None: ...
511
+ def ClearField(self, field_name: typing.Literal["has_display", b"has_display", "python_version", b"python_version", "server_os", b"server_os", "streamlit_version", b"streamlit_version"]) -> None: ...
497
512
 
498
513
  global___EnvironmentInfo = EnvironmentInfo
@@ -16,6 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  import asyncio
18
18
  import json
19
+ import os
19
20
  import sys
20
21
  import uuid
21
22
  from enum import Enum
@@ -24,7 +25,7 @@ from typing import TYPE_CHECKING, Callable, Final
24
25
  from google.protobuf.json_format import ParseDict
25
26
 
26
27
  import streamlit.elements.exception as exception_utils
27
- from streamlit import config, runtime
28
+ from streamlit import config, env_util, runtime
28
29
  from streamlit.logger import get_logger
29
30
  from streamlit.proto.ClientState_pb2 import ClientState
30
31
  from streamlit.proto.Common_pb2 import FileURLs, FileURLsRequest
@@ -742,6 +743,10 @@ class AppSession:
742
743
 
743
744
  imsg.environment_info.streamlit_version = STREAMLIT_VERSION_STRING
744
745
  imsg.environment_info.python_version = ".".join(map(str, sys.version_info))
746
+ imsg.environment_info.server_os = env_util.SYSTEM
747
+ imsg.environment_info.has_display = (
748
+ "DISPLAY" in os.environ or "WAYLAND_DISPLAY" in os.environ
749
+ )
745
750
 
746
751
  imsg.session_status.run_on_save = self._run_on_save
747
752
  imsg.session_status.script_is_running = (
@@ -20,6 +20,7 @@ from types import MappingProxyType
20
20
  from typing import TYPE_CHECKING, Any, cast
21
21
 
22
22
  from streamlit import runtime
23
+ from streamlit.runtime.context_util import maybe_add_page_path, maybe_trim_page_path
23
24
  from streamlit.runtime.metrics_util import gather_metrics
24
25
  from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
25
26
 
@@ -306,7 +307,16 @@ class ContextProxy:
306
307
  ctx = get_script_run_ctx()
307
308
  if ctx is None or ctx.context_info is None:
308
309
  return None
309
- return ctx.context_info.url
310
+
311
+ url_from_frontend = ctx.context_info.url
312
+ url_without_page_prefix = maybe_trim_page_path(
313
+ url_from_frontend, ctx.pages_manager
314
+ )
315
+ url_with_page_prefix = maybe_add_page_path(
316
+ url_without_page_prefix, ctx.pages_manager
317
+ )
318
+
319
+ return url_with_page_prefix
310
320
 
311
321
  @property
312
322
  @gather_metrics("context.ip_address")
@@ -0,0 +1,49 @@
1
+ # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ from typing import TYPE_CHECKING
18
+
19
+ if TYPE_CHECKING:
20
+ from streamlit.runtime.pages_manager import PagesManager
21
+ from streamlit.source_util import PageInfo
22
+
23
+
24
+ def maybe_trim_page_path(url: str, page_manager: PagesManager) -> str:
25
+ """Trim the page path from the URL if it exists."""
26
+ url = url.removesuffix("/")
27
+
28
+ for page in page_manager.get_pages().values():
29
+ page_url = page.get("url_pathname", "")
30
+ if page_url and url.endswith(page_url):
31
+ return url.removesuffix(page_url)
32
+
33
+ return url
34
+
35
+
36
+ def maybe_add_page_path(url: str, page_manager: PagesManager) -> str:
37
+ """Add the page path to the URL if it exists."""
38
+ url = url.removesuffix("/")
39
+
40
+ current_page_script_hash = page_manager.current_page_script_hash
41
+ current_page_info: PageInfo | None = page_manager.get_pages().get(
42
+ current_page_script_hash, None
43
+ )
44
+ if current_page_info is not None:
45
+ page_url = current_page_info.get("url_pathname", "")
46
+ if page_url:
47
+ return f"{url}/{page_url}"
48
+
49
+ return url
@@ -51,7 +51,7 @@
51
51
  <script>
52
52
  window.prerenderReady = false
53
53
  </script>
54
- <script type="module" crossorigin src="./static/js/index.ClJO7cQG.js"></script>
54
+ <script type="module" crossorigin src="./static/js/index.BpYJxTkk.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="./static/css/index.DqDwtg6_.css">
56
56
  </head>
57
57
  <body>
@@ -1 +1 @@
1
- import{r,E as a,_ as n}from"./index.ClJO7cQG.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
1
+ import{r,E as a,_ as n}from"./index.BpYJxTkk.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
@@ -1 +1 @@
1
- import{r as e,E as n,_ as a}from"./index.ClJO7cQG.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
1
+ import{r as e,E as n,_ as a}from"./index.BpYJxTkk.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};